package com.dongdongshop.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

// 声明配置类
@Configuration
public class FreemarkerConfig {

    @Bean
    public FreeMarkerConfigurer freeMarkerConfigurer(){
        // 1.
        FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
        // 2.编码格式
        configurer.setDefaultEncoding("UTF-8");
        // 3.模板加载的路径           classpath 相当于resources
        configurer.setTemplateLoaderPath("classpath:freemarker");
        return configurer;
    }
}
